import config from "@/config";
import http from "@/utils/request";

export default {
	add: {
		url: `${config.API_URL}/user/add`,
		name: "新增用户",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/user/update`,
		name: "编辑用户",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	remove: {
		url: `${config.API_URL}/user/remove`,
		name: "删除用户",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	disable: {
		url: `${config.API_URL}/user/disable`,
		name: "禁用用户",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	page: {
		url: `${config.API_URL}/user/list/page`,
		name: "用户分页列表",
		get: async function (data) {
			return await http.post(this.url, data);
		},
	},
	changeName: {
		url: `${config.API_URL}/user/set/my`,
		name: "修改用户名",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	changePassword: {
		url: `${config.API_URL}/user/change/password`,
		name: "修改密码",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	changeMyPassword: {
		url: `${config.API_URL}/user/change/password/my`,
		name: "修改密码",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
};
